fix(load_examples): better fix for load_data#12702
fix(load_examples): better fix for load_data#12702betodealmeida merged 2 commits intoapache:masterfrom
Conversation
| def load_data( | ||
| data_uri: str, dataset: SqlaTable, example_database: Database, session: Session | ||
| ) -> None: | ||
| from superset import conf |
There was a problem hiding this comment.
Use current_app.config here
|
|
||
| # reuse session when loading data if possible, to make import atomic | ||
| if example_database.sqlalchemy_uri == get_example_database().sqlalchemy_uri: | ||
| if example_database.sqlalchemy_uri == conf.get("SQLALCHEMY_DATABASE_URI"): |
There was a problem hiding this comment.
I think you should check if they're the same OR the examples URI is null, as the loader logic uses the main URI as a fallback
There was a problem hiding this comment.
example_database.sqlalchemy_uri will be set to SQLALCHEMY_DATABASE_URI if SQLALCHEMY_EXAMPLES_URI is not set, so this should catch it, no?
Codecov Report
@@ Coverage Diff @@
## master #12702 +/- ##
==========================================
- Coverage 66.93% 63.85% -3.08%
==========================================
Files 1019 487 -532
Lines 49824 30017 -19807
Branches 4877 0 -4877
==========================================
- Hits 33350 19168 -14182
+ Misses 16351 10849 -5502
+ Partials 123 0 -123
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
* fix(load_examples): better fix for load_data * Address changes (cherry picked from commit 9a159b3)
SUMMARY
Revert #12351, while fixing the problem it tried to fix.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TEST PLAN
Ran
superset load-examples, data was loaded into the examples DB and dashboards work.ADDITIONAL INFORMATION